package com.gezhi.stuserver.stumag.service;

import com.gezhi.stuserver.bean.StudentBean;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * 学生业务功能接口
 *
 * @author AWG
 */
@Transactional(readOnly = true)
public interface IStudentService {

	/**
	 * 新增学生
	 *
	 * @param studentBean 学生对象
	 */
	@Transactional(readOnly = false,propagation = Propagation.REQUIRED,isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
	void saveStudent(StudentBean studentBean);

	/**
	 * 修改学生
	 *
	 * @param studentBean 学生对象
	 */
	@Transactional(readOnly = false,propagation = Propagation.REQUIRED,isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
	void updateStudent(StudentBean studentBean);

	/**
	 * 删除学生
	 *
	 * @param studentBean 学生对象
	 */
	@Transactional(readOnly = false,propagation = Propagation.REQUIRED,isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
	void deleteStudent(StudentBean studentBean);

	/**
	 * 根据学生ID查询学生
	 *
	 * @param id 学生ID
	 * @return 学生对象
	 */
	StudentBean getStudentById(Integer id);

	/**
	 * 查询所有的学生
	 *
	 * @return 所有的学生组成的List集合
	 */
	List<StudentBean> findAllStudent();

}
